Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use our own unit conversion function in our fixes #2560

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Oct 18, 2024

Description

While performing tests for ESMValGroup/ESMValTool#3784, I noticed that our fixes do not use our own unit conversion function, which allows special unit conversions like m -> DU.

This PR adds this, but uses a "safe" version of the unit conversion which will not allow a change of the cube's standard_name (this would lead to errors in the subsequent CMOR checks).

Note: I had to restructure the functions a little bit to avoid circular imports.

Related to

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added the fix for dataset Related to dataset-specific fix files label Oct 18, 2024
@schlunma schlunma added this to the v2.12.0 milestone Oct 18, 2024
@schlunma schlunma self-assigned this Oct 18, 2024
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.79%. Comparing base (f622e40) to head (5968487).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2560      +/-   ##
==========================================
+ Coverage   94.77%   94.79%   +0.02%     
==========================================
  Files         251      251              
  Lines       14266    14280      +14     
==========================================
+ Hits        13520    13537      +17     
+ Misses        746      743       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Manu 🐊 A few questions I have, unfortunately all packed into a comment 🍺

esmvalcore/iris_helpers.py Show resolved Hide resolved
Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spiffy! Still, no alligators 😢 🐊

@valeriupredoi
Copy link
Contributor

@ESMValGroup/technical-lead-development-team could one of yous please have a last look at this then merge? 🍺

Copy link
Contributor

@rbeucher rbeucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @schlunma, thanks for fixing this.

@rbeucher rbeucher merged commit 7e16883 into main Nov 5, 2024
7 checks passed
@rbeucher rbeucher deleted the better_convert_units branch November 5, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix for dataset Related to dataset-specific fix files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants